var Adv_skd=require("./Adv_skd");

var e = require;
var t = module;
cc.Class({
    extends: cc.Component,
    properties: {pbLoading: cc.Prefab, levelSelect: cc.Node},
    onDestroy: function onDestroy() {
        "TT" == lplatform.channel && lplatform.hideBanner();
    },
    start: function start() {
        // Adv_skd.default.instance.showInterstitialAd();
        // var e = cc.instantiate(this.pbLoading);
        // if (
        //     ((e.parent = this.node),
        //     e.getComponent("Loading").aniOut(),
        //     (this.sLevelSelect = this.levelSelect.getComponent("LevelSelect")),
        //     lGlobal.model && this.showLvSelect(lGlobal.model),
        //     console.log("lplatform.labData.openAllLevel:" + lplatform.labData.openAllLevel),
        //     "Oppo" == lplatform.channel || lplatform.labData.openAllLevel)
        // )
        //     for (var t in lGlobal.userData.levelState) {
        //         for (var o = lGlobal.userData.levelState[t], n = 0; n < 300; n++) {
        //             (!o[n] || o[n] <= 0) && (o[n] = 1);
        //         }
        //     }
        // cc.audioEngine.setMusicVolume(1), lplatform.showBanner();

        Adv_skd.default.instance.showInterstitialAd();
        if (
            (
          (this.sLevelSelect = this.levelSelect.getComponent("LevelSelect")),
            lGlobal.model && this.showLvSelect(lGlobal.model),
            console.log("lplatform.labData.openAllLevel:" + lplatform.labData.openAllLevel),
            "Oppo" == lplatform.channel || lplatform.labData.openAllLevel)
        )
            for (var t in lGlobal.userData.levelState) {
                for (var o = lGlobal.userData.levelState[t], n = 0; n < 300; n++) {
                    (!o[n] || o[n] <= 0) && (o[n] = 1);
                }
            }
        cc.audioEngine.setMusicVolume(1), lplatform.showBanner();
    },
    onStartClick: function onStartClick(e, t) {
        soundMgr.playSound(soundMgr.btn), t && this.showLvSelect(t);
    },
    onModelClick: function onModelClick() {},
    onSkinClick: function onSkinClick() {
        soundMgr.playSound(soundMgr.btn), cc.director.loadScene("Shop");
    },
    showLvSelect: function showLvSelect(e) {
        (lGlobal.model = e), (this.levelSelect.active = !0), this.sLevelSelect.reset();
    },
    update: function update() {}
});
